Altest1 BEGIN 0 
RD 			EQU 	0 		:EQUATES FOR EASY I/O REFERENCE 
RC 			EQU 	1 
PD 			EQU 	2 
PC 			EQU 	3 
 			EXTRN 	DQ 
P1 			SARZ  			:Clear all registers 
			LDX		C4		:LOAD XR1 WITH 4
LoopStart 	IOWD	XX,1,RD :READ NEXT XX 
 			IOWD 	XX,1,PD :ECHO XX 
 			IOWD 	YY,1,RD :READ IN NEXT YY 
 			IOWD 	YY,1,PD :ECHO YY 
 			LD  	XX,1 	:Load AC with XX 
 			DVH 	YY,1	:FORM XX/YY, IF ZERO HALT 
 			ADD 	QQ,1	
 			ST  	QQ,1 	:STORE RESULT
 			DRXR 			:DECREMENT XR1
 			TXRP 	AllDone :TEST IF 4TH TIME THROUGH THE LOOP.  IF NOT DONE, LOOP BACK 
 			TRA 	LoopStart :IF DONE, STORE AND PRINT RESULT 
AllDone 	IOWD 	M1,0,PC 
	 		IOWD 	Q1,,PD 
	 		TRA 	E1 		:THEN GO TO THE EXIT ROUTINE 
E1 			IOWD 	M2,0,PC 
 			HALT  			:HALT 
: CONSTANTS AND TEMPORARIES 
A1 			ADRC 	DQ 		:ADDRESS OF DQ. 
A2  		ADRC 	XX 		:ADDRESS of XX. 
C1 			DEC 	1	
C4 			DEC 	4 
M1 			ACHR	'    ' 	:MESSAGE IS:  Q= 
 			ACHR	'    '	
 			ACHR	'    '	
			ACHR 	'Q='
M2			ACHR 	'END ' 
			ACHR 	'PROG' 
QQ 			BSS 	4 
Q1 			BSS 	1 
XX 			BSS 	4 
YY 			BSS 	4 
 			FINISH